<?php

/**
 * LEAGUEMan
 * 
 * Copyright (C) 2007 Marko Bischof
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');

$tm = intval(mosGetParam($_REQUEST, 'tm', 0));
$Itemid = intval(mosGetParam($_REQUEST, 'Itemid', 0));

$teammap = LM::getLMTable("Teammap");
if (!$teammap->load($tm)) {
    mosRedirect("index.php", "No such Map available");
}

$project = LM::getLMTable("Project");
if (!$project->load($teammap->teammap_project)) {
    mosRedirect("index.php", "No such Project available");
}

$team = LM::getLMTable("Team");
if (!$team->load($teammap->teammap_team)) {
    mosRedirect("index.php", "No such Team available");
}

$mainframe->setPageTitle($project->getName() . ": " . $team->getName());
$mosConfig_MetaDesc = "Team Info: " . $project->getName() . ": " . $team->getName();
$mosConfig_MetaKeys = $project->getName() . " " . $team->getName();

$template = LM::getTemplate();
$template->loadFilter("mambots");

$template->assign("project", $project);
$template->assign("team", $team);
$template->assign("teammap", $teammap);
$template->assign("Itemid", $Itemid);

$template->display("teaminfo.tpl.php");